package com.woniu.project;

import com.woniu.project.core.dto.ResultDto;
import com.woniu.project.params.shopparams.ShopConditionParams;
import com.woniu.project.params.shopparams.ShopParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "shop-server")
public interface ShopClient {

    /**
     * 分页查询所有门店信息
     * @param shopParams 查询条件对象
     * @return
     */
    @GetMapping("/pawn/shop/shop/selectShop")
    public ResultDto selectShop(ShopConditionParams shopParams);

    /**
     * 根据门店id查询单个门店信息
     * @param shopId 门店id
     * @return
     */
    @GetMapping("/pawn/shop/shop/selectOneShop/{shopId}")
    public ResultDto selectOneShop(@PathVariable("shopId") int shopId);

    /**
     * 新增/修改门店
     * @param shopParams 门店对象
     * @return
     */
    @PostMapping("/pawn/shop/shopupdateShop")
    public ResultDto updateShop(@RequestBody ShopParams shopParams);

    /**
     * 根据门店id删除门店
     * @param shopId 门店id
     * @return
     */
    @DeleteMapping("/pawn/shop/shop/deleteOneShop/{shopId}")
    public ResultDto deleteOneShop(@PathVariable("shopId") int shopId);

}
